<?php

namespace app\command;

use app\admin\model\Channel;
use app\admin\model\Custom;
use app\admin\model\Maint;
use app\admin\model\Member;
use app\admin\model\Other;
use app\admin\model\Project;
use app\admin\model\ProjectModel;
use app\admin\model\Taobao;
use app\api\model\MemberVipCard;
use app\api\model\ScenicOrder;
use think\console\Command;
use think\console\Input;
use think\console\Output;

class UpdateOrder extends Command
{
    protected function configure()
    {
        // 指令配置
        $this->setName('UpdateOrder');
        // 设置参数
        $this->setDescription('更新旅游订单状态')->setHelp("php think UpdateOrder");
    }

    protected function execute(Input $input, Output $output)
    {
        $output->writeln('开始执行');
        $map[] = ['status','=',3];
        $map[] = ['order_time','<',time()];
        (new ScenicOrder())->where($map)->update(['status' => 4,'update_time' =>time()]);
        $output->writeln('结束执行');

    }
}